<template>
  <div class="container">
    <div class="person-info border-bottom mb-10">
      <div class="title mb-10">个人信息</div>
      <div class="info-item">
        <div class="mb-10">
          <div>姓名：小明</div>
          <div>性别：小明</div>
          <div>年级：小明</div>
          <div>班级：小明</div>
        </div>
        <div>
          <div>学号：小明</div>
          <div>身份证号：小明</div>
        </div>
      </div>
    </div>
    <div class="cohabit-info border-bottom mb-10">
      <div class="item mb-10" v-for="(item,index) in dataInfo.cohabitList" :key="index">
        <div class="title">同住人{{index + 1}}信息</div>
        <div class="info">
          <div>姓名：{{item.name}}</div>
          <div>联系方式：{{item.phone}}</div>
          <div>关系：{{item.relation}}</div>
          <div>身份证号：{{item.num}}</div>
        </div>
      </div>
    </div>
    <div class="person-record">
      <div class="title mb-10">个人健康记录</div>
      <div class="items">
        <div class="item" v-for="(item,index) in dataInfo.healthList" :key="index">
          <div class="date-time mr-20">{{item.time}}</div>
          <div class="info">{{item.text}}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      dataInfo: {
        cohabitList: [
          { name: '张三', phone: '1111', relation: '母女', num: '410***123' },
          { name: '张三', phone: '1111', relation: '母女', num: '410***123' },
          { name: '张三', phone: '1111', relation: '母女', num: '410***123' },
          { name: '张三', phone: '1111', relation: '母女', num: '410***123' }
        ],
        healthList: [
          { time: '2022.05.10', text: '抗原异常' },
          { time: '2022.05.10', text: '抗原异常' },
          { time: '2022.05.10', text: '抗原异常' },
          { time: '2022.05.10', text: '抗原异常' },
          { time: '2022.05.10', text: '抗原异常' },
          { time: '2022.05.10', text: '抗原异常' },
          { time: '2022.05.10', text: '抗原异常' },
          { time: '2022.05.10', text: '抗原异常' },
          { time: '2022.05.10', text: '抗原异常' },
          { time: '2022.05.10', text: '抗原异常' },
          { time: '2022.05.10', text: '抗原异常' }
        ]
      }
    }
  }
}
</script>

<style lang='scss' scoped>
.container {
  max-height: calc(100vh - 200px);
  overflow: hidden;
  overflow-y: auto;
}
.border-bottom {
  border-bottom: 1px solid #ccc;
}
.title {
  font-size: 18px;
  font-weight: 600;
}
.info-item {
  padding-left: 20px;
  padding-bottom: 10px;
  & > div {
    display: flex;
    > div {
      flex: 1;
    }
  }
}
.cohabit-info {
  max-height: 200px;
  overflow: hidden;
  overflow-y: auto;
  .item {
    .info {
      display: flex;
      padding-left: 20px;
      > div {
        margin-right: 50px;
      }
    }
  }
}
.person-record {
  .items {
    max-height: 200px;
    overflow: hidden;
    overflow-y: auto;
    .item {
      padding-left: 20px;
      display: flex;
    }
  }

}
</style>
